<?php
/**
 * @example
 * 
 * require_once '../requires.php';
 * Session::start(); 				//start
 * Session::sess('var', 'str'); 	//add or update
 * Session::sess('var');			//get
 * Session::sess('var', null);		//delete
 * Session::clear()					//clear , i.e use for log out
 * Session::end(); 					//end
*/
require_once '../requires.php';

//set a simple value
$cfg = array(
	'handler' => 'File',
);
Session::start($cfg);

$var = 'yulin';
//$_SESSION['var'] = $var;
Session::sess('var', $var);

//set a reference
$ref = &$var;
Session::sess('ref', $ref);

//set a resource type(please don't use to session resource)
$res = fopen('file.txt', 'wb');
Session::sess('res', $res);

//set a object
class A {
	public $name;
	public $a;
	public function __construct() {
		$this->name = 'yulin';
		$this->a = $this;
	}
}

$a = new A();
Session::sess('a', $a);

Session::end();
?>